<!--
จำเป็นต้องมีสำหรับ หน้า print
div => "head" ถูกแสดงด้านบนทุกหน้า
thead => "tableHead" หัวตารางที่จะถูกแสดงทุกหน้า
2 => "" หัวตารางที่จะถูกแสดงทุกหน้า
tr => "row[no]" แถวในตาราง, class => "row"
td => class => "rowTd" ใช้หาความสูงแดวตารางใน IE
tr => "emptyRow" แถวว่างท้ายตาราง
4 => "foot" แสดงที่ส่วนท้ายทุกหน้า
-->
<div id="divFirstHeader"></div>  <div class="header">
    <div class="title">
        <?php echo $this->element('print/title'); ?>
        <table>
            <tr>
                <td width="120px"><label>Vendor</label></td>
                <td><?php echo $this->data['Supplier']['name']; ?></td>
            </tr>
        </table>
    </div>
    <div class="documentTitle">
        <div class="documentNote">RETURN NOTE</div>
        <table class="documentNo">
            <tr>
                <td><label>Vendor no.</label></td>
                <td><?php echo $this->data['Supplier']['code']; ?></td>
                <td><label>Return no.</label></td>
                <td><?php echo $this->data['SRH']['retrieve_no']; ?></td>
            </tr>
        </table>
        <table>
            <tr>
                <td>
                    <label>Return date</label>
                    <?php echo $this->data['SRH']['retrieve_date']; ?>
                </td>
                <td><label>Page</label></td>
                <td><span class="pageNo">1/1</span></td>
            </tr>
            <tr>
                <td width="130px"><label>Ref by Customer<br />Return no.</label></td>
                <td colspan="3"><?php echo $this->data['CRtSH']['return_no']; ?></td>
            </tr>
            <tr>
                <td><label>Status</label></td>
                <td colspan="3"><?php echo $this->data['RS']['title']; ?></td>
            </tr>
            <tr>
                <td><label>Vendor Document no.</label></td>
                <td colspan="3"><?php echo !empty($this->data['CRtSH']['vendor_document_no'])? $this->data['CRtSH']['vendor_document_no']: '-' ?></td>
            </tr>
            <tr>
                <td><label>Return by</label></td>
                <td colspan="3"><?php echo $this->data['SRH']['retrieve_by']; ?></td>
            </tr>
        </table>
    </div>
    <table class="wide clear">
        <tr>
            <td width="120px"><label>Customer no.</label></td>
            <td width="272px"><?php echo $this->data['Customer']['cust_no']; ?></td>
            <td width="80px"><label>Site no.</label></td>
            <td><?php echo $this->data['Site']['site_no']; ?></td>
        </tr>
        <tr>
            <td><label>Customer name</label></td>
            <td><?php echo $this->data['Customer']['name']; ?></td>
            <td><label>Site name</label></td>
            <td><?php echo $this->data['Site']['name']; ?></td>
        </tr>
    </table>
</div>

<div class="main">
    <table id="dataTable" class="dataTable" cellspacing="0" cellpadding="0" >
        <thead id="tableHead">
            <tr align="center">
                <th width="40px">Item<br>ลำดับ</th>
                <th width="120px">Part Number<br>รหัสสินค้า</th>
                <th>Description<br />รายการ</th>
                <th width="45px">Qty<br />จำนวน</th>
                <th width="45px">Unit<br />หน่วย</th>
                <th width="70px">Price/Unit<br>ราคา/หน่วย</th>
                <th width="70px">Amount<br>จำนวนเงิน</th>
            </tr>
        </thead>
        <tbody id="tableBody">
            <?php $i = 0;
            foreach($this->data['SR'] as $sdr) : ?>
            <tr id="row<?php echo $i; ?>" class="row">
                <td class="center rowTd"><?php echo ($i + 1); ?></td>
                <td>
                    <?php echo $sdr['Product']['supplier_part_no']; ?><br />
                    <?php echo $sdr['CustProductSite']['stock_code']; ?>
                </td>
                <td><?php echo $sdr['Product']['text']; ?></td>
                <td class="center"><?php echo $sdr['Product']['Unit']['title']; ?></td>
                <td class="center"><?php echo $sdr['retrieve_qty']; ?></td>
                <td class="text-right"><?php echo number_format($sdr['price'], 2); ?></td>
                <td class="text-right"><?php echo number_format($sdr['price'] * $sdr['retrieve_qty'], 2); ?></td>
            </tr>
            <?php endforeach; ?>
            <?php for ($i = 0; $i < 30; ++$i) : ?>
            <tr class="emptyRow"> <!-- สร้างแถวเปล่าขึ้นมาเพื่อยืดขนาดตารางให้เต็มหน้า-->
                <td class="rowTd">&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td>
            </tr>
            <?php endfor; ?>
        </tbody>
    </table>
</div>

<div class="footer">
    <div class="remark">
        <label>Remark</label><br />
        <?php echo $this->data['SRH']['remark']; ?>
    </div>
    <div class="custSignature">
        <hr />
        <span>Vendor/Date</span>
    </div>
</div>
